<template>
  <!--监控视频-->
  <div class="montior_video">
    <div class="video_list">
      <div @click="toVideo2(item.link)" class="video_box" v-for="(item,index) in videoList" :key="index">
        <img style="object-fit: cover;width: 100%;height: 100%;"
             :src="item.thumb" alt="">
            <p class="video_list_title">{{item.title}}</p>
      </div>
    </div>
  </div>
  <!--监控视频-->
</template>

<script>
  export default {
    name: "Monitor",
    data() {
      return {
        videoList: [],//视频列表
      }
    },

    created() {
      this.getVideoList();
    },

    methods: {
      getVideoList() {
        let that = this;
        that.$http.get("api/ScreenkApi/getVideos?page=1&limit=10000&type=2", {vollege_id:that.$util.vollege_id}, r => {
          console.log('视频列表：', r.data.data);
          that.videoList = r.data.data;
        });
      },//获取视频列表
      toVideo2(url) {
        console.log("视频:", url);
        this.$util.storage.set("videourl", url);
        this.$router.push('/video2');
      },//跳转到视频播放页面
    }
  }
</script>

<style scoped>
  .montior_video {
    height: 641px;
    box-sizing: border-box;
    padding: 60px;
  }

  .video_list {
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .video_box {
    width: 298px;
    height: 240px;
    border-radius: 6%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 40px;
    position: relative;
  }
  .video_list_title{
        position: absolute;
        bottom: 0px;
        color: #fff;
        padding: 1px 11px;

        background-color: rgb(0,0,0,.5);
        height: 60px;
        text-align: center;
        width: 300px;
        line-height: 47px;
  }

</style>
